package com.zut.blocks.base.service.impl;

import com.zut.blocks.base.dao.GenericRepository;
import com.zut.blocks.base.service.GenericService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.io.Serializable;

public class GenericServiceImpl<T, PK extends Serializable> implements GenericService<T, PK> {
    protected GenericRepository<T, PK> dao;

    public Iterable<T> findAll() {
        return this.dao.findAll();
    }

    public Page<T> findAll(Pageable page) {
        Page<T> result = this.dao.findAll(page);
        return result;
    }
}
